package com.example.databinding.RecycleView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.databinding.DataBindingUtil;
import androidx.databinding.ViewDataBinding;
import androidx.recyclerview.widget.LinearLayoutManager;

import android.os.Bundle;

import com.example.databinding.R;
import com.example.databinding.adapter.IdolRecycleViewAdapter;
import com.example.databinding.databinding.ActivityIdolRecycleViewBinding;
import com.example.databinding.util.IdolsUtil;

public class IdolRecycleView extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        ActivityIdolRecycleViewBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_idol_recycle_view);
        IdolRecycleViewAdapter adapter = new IdolRecycleViewAdapter(new IdolsUtil().get());
        binding.recycleview.setLayoutManager(new LinearLayoutManager(this));
        binding.recycleview.setAdapter(adapter);
    }
}